Socket
Socket
Sign inDemoInstall

daemonize-process

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

daemonize-process

Daemonize the current Node.js process


Version published
Weekly downloads
11K
increased by4.61%
Maintainers
1
Weekly downloads
 
Created
Source

daemonize-process

Daemonize the current Node.js process

The module re-spawns the current process and then exits, which will lead to the new child process being adopted by init or similar mechanisms, effectively putting the current process into the background. Differences to the popular daemon module include:

  • Fully configurable, exposes all options of child_process.spawn.
  • Cleans up process.env after itself.
  • Works on Node.js >= 8.

Install

$ npm install --save daemonize-process

Example

require('daemonize-process')();

API

daemonizeProcess([options])

The options object can contain any valid child_process.spawn option as well as these properties:

  • script string - The path to the script to be executed. Default: The current script.
  • arguments Array - The command line arguments to be used. Default: The current arguments.
  • node string - The path to the Node.js binary to be used. Default: The current Node.js binary.
  • exitCode number - The exit code to be used when exiting the parent process. Default: 0.

By default the standard streams of the child are ignored (e.g. attached to /dev/null or equivalent). If you need these streams, adjust the stdio option.

License

© silverwind, distributed under BSD licence

Keywords

FAQs

Package last updated on 07 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc